package com.financialsharing.controller;


import com.financialsharing.common.ServerResponse;
import com.financialsharing.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lvyongwei
 */
@RestController
@RequestMapping("/chart")
public class ChartController {

    @Autowired
    private UserService userService;

    /**
     * 获取首页图表内容
     * @return
     */
    @GetMapping("/topPage")
    public ServerResponse getTopPage(){
        try{
            return userService.getTopPageCount();
        }catch (Exception e){
            return ServerResponse.createByErrorMsg("查询图表内容失败");
        }
    }
}
